import request from '@/utils/request'

// 查询考试时间安排列表
export function listExamSchedule(query) {
  return request({
    url: '/business/examSchedule/list',
    method: 'get',
    params: query
  })
}

// 查询考试时间安排所有列表
export function listAllExamSchedule(query) {
  return request({
    url: '/business/examSchedule/listAll',
    method: 'get',
    params: query
  })
}

// 查询考试时间安排详细
export function getExamSchedule(id) {
  return request({
    url: '/business/examSchedule/getInfo/' + id,
    method: 'get'
  })
}

// 新增考试时间安排
export function addExamSchedule(data) {
  return request({
    url: '/business/examSchedule/add',
    method: 'post',
    data: data
  })
}

// 修改考试时间安排
export function updateExamSchedule(data) {
  return request({
    url: '/business/examSchedule/edit',
    method: 'post',
    data: data
  })
}

// 删除考试时间安排
export function delExamSchedule(id) {
  return request({
    url: '/business/examSchedule/remove/' + id,
    method: 'get'
  })
}

// 根据考试ID查询启用的考试时段并统计报名人数
export function listByExamIdWithCount(examId) {
  return request({
    url: '/business/examSchedule/listByExamIdWithCount/' + examId,
    method: 'get'
  })
}

// 导出考试人员名单
export function exportRegistrationList(data) {
  return request({
    url: '/business/examSchedule/exportRegistrationList',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}